From 9c8f5290ef3d666eb6867de26ac7ba85508b5fb6 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 17 Jun 2006 12:57:03 +0100 Subject: [PATCH] Small fixes to changesets 10424 and 10425 (spurious #PF detection). Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c | 2 +- xen/arch/x86/traps.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c b/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c index 963446013f..cb3fe42f0e 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/fault-xen.c @@ -324,7 +324,7 @@ static int spurious_fault(struct pt_regs *regs, #endif /* Reserved-bit violation or user access to kernel space? */ - if (error_code & PF_RSVD|PF_USER) + if (error_code & (PF_RSVD|PF_USER)) return 0; pgd = init_mm.pgd + pgd_index(address); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 9b0b7e31c6..e80f71326c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -592,6 +592,10 @@ static int __spurious_page_fault( l1_pgentry_t l1e, *l1t; unsigned int required_flags, disallowed_flags; + /* Reserved bit violations are never spurious faults. */ + if ( regs->error_code & PGERR_reserved_bit ) + return 0; + required_flags = _PAGE_PRESENT; if ( regs->error_code & PGERR_write_access ) required_flags |= _PAGE_RW; @@ -654,10 +658,6 @@ static int spurious_page_fault( struct domain *d = v->domain; int is_spurious; - /* Reserved bit violations are never spurious faults. */ - if ( regs->error_code & PGERR_reserved_bit ) - return 0; - LOCK_BIGLOCK(d); is_spurious = __spurious_page_fault(addr, regs); -- 2.30.2